export const parseSearch = (search) => {
  try {
    if (!search) return {};
    search = search.substr(1);
    let searchArr = search.split('&');
    let obj = {};

    searchArr.forEach(value => {
      const arr = value.split('=');
      if (arr[0] !== undefined) {
        obj[arr[0]] = arr[1];
      }
    });
    return obj;
  } catch (e) {
    return {};
  }
}
